export default function render(v) {

  return v && v
    .replace(/\*\*(.*?)\*\*/g, '<strong class="x-strong">$1</strong>')
    .replace(/\*(.*?)\*/g, '<em>$1</em>')
    .replace(/`(.*?)`/g, '<code class="x-code">$1</code>')
    .replace(/~~(.*?)~~/g, '<del>$1</del>')
    .replace(/---/g, '<div class="c-hr"></div>')
    .replace(/\[(.*?)\]\((.*?)\)/g, '<a href="$2" class="c-link">$1</a>') // []()为链接
    .replace(/__(.*?)__/g, '<u>$1</u>') // __为下划线
    .replace(/^-(.*?)$/gm, '<li>$1</li>') // -为无序列表
    .replace(/^(> .+(\n> .+)*)$/gm, (match) => {
      const r = match.split('\n').map(line => line.replace(/^\s*>\s+/gm, '')).join('\n')
      return `<blockquote class="c-blockquote">${render(r)}</blockquote>`
    })
    .replace(/(?<!<\/div>)(?<!<\/blockquote>)\n/g, '<br>')
}
